{include file="public/header" /}
<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>新建</h5>
                </div>
                <div class="ibox-content layui-form">
                    <div class="layui-row layui-col-space10 layui-form-item ">

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">选择学校：</label>
                            <div class="layui-input-block">
                                <select name="school" lay-verify="required" lay-search>
                                    <option value="">请选择学校</option>
                                    {volist name='school' id='s'}
                                    <option value="{$s.school_erp}">{$s.school_name}</option>
                                    {/volist}
                                </select>
                            </div>
                        </div>
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">年份：</label>
                            <div class="layui-input-block">
                                <input type="number" name="year" min="2000" step="1" lay-verify="number" placeholder="年份" class="layui-input" value="{$year}">
                            </div>
                        </div>
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">身高项：</label>
                            <div class="layui-input-block">
                                <input type="radio" name="height" value="1" title="采集" checked>
                                <input type="radio" name="height" value="2" title="不采集" >
                            </div>
                        </div>
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">体重项：</label>
                            <div class="layui-input-block">
                                <input type="radio" name="weight" value="1" title="采集" checked>
                                <input type="radio" name="weight" value="2" title="不采集" >
                            </div>
                        </div>
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">收货信息：</label>
                            <div class="layui-input-block">
                                <input type="radio" name="send" value="1" title="采集" checked>
                                <input type="radio" name="send" value="2" title="不采集" >
                            </div>
                            <span>收货信息含两项：收件人、收件地址</span>
                        </div>
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <div class="layui-input-block">
                                <button class="layui-btn" lay-submit="" lay-filter="component-form-element">发布
                                </button>
                                <button class="layui-btn layui-btn-primary" onclick="history.go(-1)">关闭</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{include file="public/footer" /}
<script>
    layui.use(['form','upload','layedit','laydate'], function() {
        var form = layui.form;
        form.on('submit(component-form-element)', function (data) {
            $('.layui-btn').addClass('layui-disabled').attr('disabled','disabled');
            $.ajax({
                url:"{:url('activeAdd')}",
                type:'post',
                dataType:'json',
                data:data.field,
                success:function(res){
                    if (res.code == 200) {
                        wk.success(res.msg,"{:url('Wechat/schcode')}")
                    } else {
                        wk.error(res.msg,'','$(".layui-btn").removeClass(\'layui-disabled\').removeAttr(\'disabled\');');
                    }
                }
            })
        });
        form.on('select(role)', function(data){
            if(data.value == 1){
                $('#money').addClass('hidden');
            }else if(data.value == 2){
                $('#money').removeClass('hidden');
            }else{
                $('#money').removeClass('hidden');
            }
        });
    });
</script>

</body>
</html>
